package no.sachmuld.methodcombination.impl.validate;

import no.sachmuld.methodcombination.api.BehaviourMethod;

/**
 *
 */
public class MissingBehaviourMethod extends MethodCombinationValidationError {
    private BehaviourMethod behaviourMethod;

    public MissingBehaviourMethod(BehaviourMethod behaviourMethod) {
        super(behaviourMethod.getBehaviourClass());
        this.behaviourMethod = behaviourMethod;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Missing method ");
        sb.append(format(behaviourMethod.getMethodName(), behaviourMethod.getParameterTypes()));
        sb.append(" in behaviour class ");
        sb.append(behaviourMethod.getBehaviourClass().getName());
        return sb.toString();
    }
}
